import requests

class Ihrm:
    def ihrm_post(self,req_headers,req_body):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
                             headers=req_headers,
                             json=req_body)
        return resp
    #查询
    def ihrm_get(self,id,req_headers):
        resp = requests.get(url="http://ihrm2-test.itheima.net/api/sys/user/"+id,
                            headers=req_headers)
        return resp
    # 修改员工
    def ihrm_put(self,id,req_headers,req_body):
        resp = requests.put(url="http://ihrm2-test.itheima.net/api/sys/user/"+id,
                            headers=req_headers,
                            json=req_body)
        return resp

    # 删除员工delete
    def ihrm_delete(self,id,req_headers):
        resp = requests.delete(url="http://ihrm2-test.itheima.net/api/sys/user/"+id,
                               headers=req_headers)
        return  resp

